package com.wudi.estate.service.impl.homemanage;

import com.wudi.estate.bean.homemanage.Buildings;
import com.wudi.estate.mapper.homemanage.BuildingsMapper;
import com.wudi.estate.service.homemanage.BuildingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BuildingsServiceImpl implements BuildingsService {
    @Autowired
    private BuildingsMapper buildingsMapper;

    @Override
    public Buildings selectById(Buildings b) throws Exception {

        return buildingsMapper.selectById(b.getId());
    }

    @Override
    public List<Buildings> selectAll() throws Exception {
        return buildingsMapper.selectList(null);
    }

    @Override
    public void upadteById(Buildings b) throws Exception {
        buildingsMapper.updateById(b);
    }

    @Override
    public void insert(Buildings buildings) throws Exception {
        buildingsMapper.insert(buildings);
    }

    @Override
    public Buildings selectById(long id) throws Exception {
        return buildingsMapper.selectById(id);
    }
}
